<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'getOrderList.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="css/mystyle.css">
<script
	src="http://static.runoob.com/assets/jquery-validation-1.14.0/lib/jquery.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script type="text/javascript" src="js/messages_zh.js"></script>
<script type="text/javascript" src="js/china.js"></script>

</head>

<body>
	<header>
	<div class="nav">
		<c:if test="${lf==null}">
			<form id="LoginForm" action="LoginServlet" method="post">
				<label style="color:red;font-size:12px;" id="showLogin">欢迎光临集大杂货铺,请登录/注册</label>
				<a class="divhover" style="margin-left: 20px;" href="GetTenGoodsServlet">首页</a> 
				<a class="divhover" onclick="if(${empty lf}) alert('请先登录');" href="GetTenGoodsServlet">个人订单</a>
				<a class="divhover" onclick="if(${empty lf}) alert('请先登录');" href="GetTenGoodsServlet">购物车</a>
			</form>
		</c:if>
		
		<c:if test="${lf!=null}">
			<a>欢迎 , ${user.uname},您上次登录时间是${lastlogintime} </a>
			<a href="userinfo.jsp?uid=${user.uid}">修改信息</a>
			<a href="LogoutServlet?uid=${user.uid}">注销</a>
			<a href="GetTenGoodsServlet">首页</a>
			<a href="servlet/GetOrderList">个人订单</a>
			<a href="servlet/ShowShoppingcart">购物车</a>
		</c:if>
		<div id="time">
			<script>
				document.getElementById('time').innerHTML = new Date()
						.toLocaleString()
						+ ' 星期' + '日一二三四五六'.charAt(new Date().getDay());
				setInterval(
						"document.getElementById('time').innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",
						1000);
			</script>
		</div>
	</div>
	</header>
	<div class="orderborder">
		<c:forEach items="${details }" var="detail">
			<div class="box1">
				<span class="orderid">订单号：${detail.aid } 创建时间：${detail.createtime}</span>
				<c:forEach items="${detail.TGoods }" var="goods">
					<div class="boxdiv">
						<img src="${goods.gphoto}" class="goodsimage"><span class="ordertext">${goods.gname}</span>
					</div>
				</c:forEach>
				<a class="checkorder" href="${pageContext.request.contextPath}/servlet/ShowOrderDetail?aid=${detail.aid }">查看订单详情</a>
			</div>
		</c:forEach>
	</div>
</body>
</html>
